//
//  NSMapTable+RACSequenceAdditions.m
//  高仿暴走斗图
//
//  Created by key on 16/9/23.
//  Copyright © 2016年 huangsongyao. All rights reserved.
//

#import "NSMapTable+RACSequenceAdditions.h"
#import "NSEnumerator+RACSequenceAdditions.h"

@implementation NSMapTable (RACSequenceAdditions)

- (RACSequence *)rac_sequence {
    NSMapTable *mapTable = [self copy];
    
    // TODO: First class support for dictionary sequences.
    return [mapTable.keyEnumerator.rac_sequence map:^(id key) {
        id value = [mapTable objectForKey:key];
        return RACTuplePack(key, value);
    }];
}

- (RACSequence *)rac_keySequence {
    return self.keyEnumerator.rac_sequence;
}

- (RACSequence *)rac_valueSequence {
    return self.objectEnumerator.rac_sequence;
}

@end
